SAVE

Syntax: SAVE device_filename {,range}
    or: SAVE [device_] filename {,range} (Toolkit II)
    or: SAVE             (SMS only)
Location: QL ROM, Toolkit II

If no line range is given, this command saves the whole of the currently loaded SuperBASIC program to the given directory device, under the given filename. However, a range of lines can be given (as with LIST), in which case only the given lines will be saved.

If the filename already exists on that device, the error 'Already Exists' is reported, unless you have Toolkit II present, in which case, a prompt will be printed in #0 asking you whether it is okay to overwrite that file.

If the device is already full, the 'Device Full' error is reported, however, the effects should the drive become full during the actual SAVE command, depends upon the implementation (see below).

The Toolkit II variant of the command will add the data default directory to the filename if it cannot find the given device, or no device is specified.

Example:
SAVE flp1_BOOT
SAVE cut_bas,1,100 TO 150,300 TO

SMS NOTES:
The third variant of the command will allow you to SAVE the program in memory under the same filename as when LOAD or QLOAD was last used (with the _BAS suffix appended if necessary).  If the original filename used when the program was LOADed ended in _SAV, then SAVE will alter this to be the _BAS suffix.  This variant will also take the version number of the file when it was LOADed (or QLOADed) and then increase this by one.

CROSS-REFERENCE:
LOAD loads a saved file from the given device into memory. 
SAVE_O is another variant of this command.
See also QSAVE for a different means of SAVEing a SuperBASIC program.
